package org.cuatrovientos.erp.business;

import java.util.List;

import org.cuatrovientos.erp.model.Supplier;
import org.cuatrovientos.erp.dao.SupplierDAO;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author Daniel Lacasta
 *
 */
public class SupplierBO implements BOGenericInterface {
	
	// Get log4j logger
	private static final Logger logger = Logger.getLogger(SupplierBO.class);
	
	@Autowired
    private SupplierDAO supplierDAO;

	@Override
	public Supplier selectById(int id) {
		logger.info("selectById: " + id);
		return supplierDAO.selectById(id);
	}

	@Override
	public List<Supplier> selectAll() {
		logger.info("selectAll: ");
		return supplierDAO.selectAll();
	}



	@Override
	public void deleteById(int id) {
		logger.info("delete: " + id);
		 supplierDAO.delete(id);
	}

	@Override
	public void insert(Object supplier) {
		logger.info("insert: " + supplier);
		supplierDAO.insert(supplier);
	}

	@Override
	public void update(Object supplier) {
		logger.info("update: " + supplier);
		supplierDAO.update(supplier);
	}


}
